home *** CD-ROM | disk | FTP | other *** search
- /* arexx Script
- */
-
- call addlib("rexxmathlib.library", 5, -30, 0)
-
- options results
- parse ARG Port b
-
- ADDRESS value Port
-
- if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/LTransferAnim') THEN DO
- IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/LTransferAnim', "R") then DO
- file = READLN('lfile')
- CALL CLOSE('lfile')
- file2=""
- do i=1 to LENGTH(file)
- a=SUBSTR(file,i,1)
- if a=" " then DO
- a="*"
- END
- file2=file2||a
- END
- file=file2
- END
- END
-
- pp_DialogInit 250 80 "*Load*Transfer*Animation" 2
- pp_String 0 50 12 150 16 "file" 1 100 file
- n=LASTPOS('/',file)
- if n=0 then DO
- n=LASTPOS(':',file)
- file=SUBSTR(file,1,n)
- END
- else DO
- file=SUBSTR(file,1,n)
- END
- pp_Getfile 1 205 13 0 "Select*Path" 0 file
- pp_Dialog
-
- rc=result
- if rc=0 then
- do
- pp_PermitRefresh
- EXIT
- end
-
- pp_GetDialog 0
- file=result
-
- CALL SavePrefs('LTransferAnim',file)
-
- Width=0
-
- if ~exists(file||'.info') then DO
- pp_Warn "Can't*find*'.info'*file."
- pp_DialogInit 250 80 "*Load*Transfer*Animation" 1
- pp_integer 3 50 12 70 16 "Width*of*one*frame" 1 Width
- pp_Dialog
- rc=result
- if rc=0 then DO
- pp_PermitRefresh
- EXIT
- end
- pp_GetDialog 0
- Width=result
- END
-
- if Width=0 then DO
- pp_FindToolvalue file "WIDTH"
- IF result~="" then DO
- Width=result
- END
- ELSE DO
- pp_FindToolvalue file "SIZE"
- IF result~="" then DO
- W1=LASTPOS(",",result)
- Width=SUBSTR(result,1,W1-1)
- END
- ELSE DO
- pp_FindToolValue file "FRAMEWIDTH"
- IF result~="" then DO
- Width=result
- END
- END
- END
- END
-
- pp_GetCurrentBuffer
- CBf=result
- pp_GetCurrentBrush
- B0=result
-
- pp_Load file
-
- pp_GetDepth
- D=result
- pp_GetWidth
- W=result
- pp_GetHeight
- H=result
-
- if D<24 then DO
- pp_Psave "ram:palette.trash" 0
- END
-
- pp_FindEmptyBrush
- Brush=result
- if Brush=-1 then DO
- pp_Warn "can't*find*empty|Brush."
- EXIT
- END
- pp_SetBrush Brush
-
- pp_FindEMptyBuffer
- Bf=result
- if Bf=-1 then DO
- pp_Warn "can't*find*empty|Buffer."
- EXIT
- END
- pp_SetBuffer Bf
-
- pp_New Width H D
- pp_GetWidth
- if result=0 then DO
- pp_Warn "Not*enough*memory."
- EXIT
- END
-
- pp_AnimGui 1
- IF result<2 then DO
- EXIT
- END
- count=trunc(W/Width)
- pp_MakeAnim count
- pp_CountFrames
- IF result<2 then DO
- pp_Warn "Can't*create*animation."
- EXIT
- END
-
- if D<24 then DO
- pp_Pload "ram:palette.trash"
- ADDRESS COMMAND
- 'delete >nil: ram:palette.trash'
- ADDRESS value Port
- END
-
- X2=Width/2
- Y2=H/2
-
- PB=0
-
- DO i=1 to count
- pp_SetBuffer CBf
- pp_PickBrush PB 0 Width H
- pp_SetBuffer Bf
- pp_Plot X2 Y2
- pp_NextFrame
- PB=PB+Width
- END
-
- pp_SetBuffer CBf
- pp_ClearCurrentBuffer
- pp_SetBuffer Bf
-
- pp_FreeBrush
- pp_SetBrush B0
-
-
- EXIT
-
- SavePrefs: PROCEDURE
-
- Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
-
- if EXISTS(Prefname) THEN DO
- ADDRESS COMMAND
- 'delete >nil: '||Prefname
- END
-
- IF OPEN('pfile',PrefName,'W') THEN DO
-
- do i=2 to ARG()
- CALL WRITELN('pfile',ARG(i))
- end
-
- CALL CLOSE('pfile')
-
- RETURN
-
-
-
-
-